package com.itheima.reggie.common;

public class BaseContext {
    // 添加ThreadLocal这个Java自带的类
    private static final ThreadLocal<Long> THREAD_LOCAL = new ThreadLocal<>();

    //编写静态方法用于设置sessionID
    public static void setCurrentId(Long id) {
        THREAD_LOCAL.set(id);
    }


    //编写静态方法用于获取sessionID
    public static Long getCurrentId() {
        return THREAD_LOCAL.get();
    }
}
